Communication control for multi-layer communications

ABSTRACT

Disclosed are a communication control apparatus and a communication control method for re-establishing the connection of a line when a user disconnects the line by mistake during the transmission of data, and a storage medium therefor.  
     According to the present invention, when a lower layer is disconnected while data is being transmitted to another apparatus, an upper layer is so controlled that it maintains a session for a predetermined period of time, and when a line connection is re-established within the predetermined period of time, establishes a connection for the transmission of data.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to processing performed to remove an abnormality on a data communication line, and to a printing process for the transmission of data along, for example, an IEEE 1394 line.

[0003] 2. Related Background Art

[0004] Since for the performance of a communication process across a so-called centronics line only an image data source and a printer are connected together, basically, even when a physical line is disconnected, the canceling of a session is not required unless a user physically breaks the connection. And when data are being transmitted to other apparatuses, if a lower layer is disconnected from a line, accordingly an upper layer is immediately disconnected from the line.

[0005] Assume that, as provided for by the IEEE 1394 specification, a plurality of image data sources and a plurality of printers are connected together along a single, closed communication line. If, for example, one of the image sources that is connected to the line and that is transmitting data is disconnected, and if a printer that during a session communicates with that image data source continues to be connected to the source, as with a centronics line, the printer will be unable to transmit data to other image data sources on the line.

[0006] If an upper layer is disconnected immediately after a lower layer is disconnected, or if the disconnection and the re-connection of a line is performed due to the careless performance of an operation by a user or due to a rearrangement of apparatuses, the printing process must be repeated from the beginning. As a result, an undesirable, excessive expenditure of time, paper and ink (toner, etc.)

occurs. SUMMARY OF THE INVENTION

[0007] It is, therefore, one objective of the present invention to provide a communication control apparatus and a communication control method for re-connecting a system that, during a data transmission session, has been disconnected from a line due to the careless performance of an operation by a user, and a storage medium therefor.

[0008] To achieve the above objective, according to the present invention, a communication control apparatus comprises:

[0009] control means for, if a lower layer is disconnected while data is being transmitted to an apparatus, permitting an upper layer to continue to maintain a session for a predetermined period of time, and for, if a line connection is re-established within the predetermined period of time, permitting the upper layer to establish a connection for the transmission of data.

[0010] Further, according to the present invention, a communication control method comprises:

[0011] a control step for, if a lower layer is disconnected while data is being transmitted to an apparatus, permitting an upper layer to continue to maintain a session for a predetermined period of time, and for, if a line connection is re-established within the predetermined period of time, permitting the upper layer to establish a connection for the transmission of data.

[0012] Furthermore, according to the present invention, provided is a storage medium, on which is stored a communication control program, the communication control program comprising:

[0013] a control step for, if a lower layer is disconnected while data is being transmitted to an apparatus, permitting an upper layer to continue to maintain a session for a predetermined period of time, and for, if a line connection is re-established within the predetermined period of time, permitting the upper layer to establish a connection for the transmission of data.

BRIEF DESCRIPTION OF THE DRAWINGS

[0014]FIG. 1 is a diagram showing an example system configuration for which the present invention can be applied;

[0015]FIG. 2 is a hardware block diagram showing a host computer according to one embodiment of the present invention;

[0016]FIG. 3 is a hardware block diagram showing a printer according to one embodiment of the present invention;

[0017]FIG. 4 is a flowchart showing a print data transmission program;

[0018]FIG. 5 which is composed of FIGS. 5A and 5B are flowcharts showing the processing performed by the host computer when the printer is disconnected from a bus during the transmission of print data;

[0019]FIG. 6 is a flowchart showing the processing performed when the operating condition of the printer is normal;

[0020]FIG. 7 is a flowchart showing the processing performed by the printer when the host computer is disconnected from the bus during the transmission of print data; and

[0021]FIG. 8 is a diagram showing the relationship between an OSI seven layer model and the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0022] The preferred embodiments of the present invention will now be described in detail while referring to the accompanying drawings.

(First Embodiment)

[0023]FIG. 1 is a diagram showing an example system configuration for which the present invention is applied.

[0024]FIG. 2 is a block diagram illustrating the internal components of a host computer shown in FIG. 1. The host computer comprises: a CPU 1, for controlling the overall operations of a host computer of the present invention; a RAM 2, used as a work area for the CPU 1; a memory (a hard disk, a floppy disk, or a CDROM) 3 in which control programs, including those for flowcharts in FIG. 4 and FIGS. 5A and 5B of the present invention, are stored; an input unit (specifically, a mouse or a keyboard) 4, used by a user to enter a command; an IEEE 1394 controller 5; a user I/F display 6, specifically a display device; and a main bus 8.

[0025]FIG. 3 is a block diagram illustrating the internal components of a printer in FIG. 1. The printer comprises: a CPU 11, for controlling the printer; a RAM 12, used as a work area for the CPU 11; a ROM (a floppy disk, a CD-ROM or a hard disk) 14, in which are stored control programs, including those for the flowcharts in FIGS. 6 and 7 for the present invention; an IEEE 1394 controller 15; a printer engine 16; and a main bus 18.

[0026] It should be noted that, even though not specifically described, in the host computer the CPU 1 controls the RAM 2, the memory 3, the input unit 4, and the IEEE 1394 controller 5, via the main bus 8. In the printer, the CPU 11 controls the RAM 12, the ROM 13, the IEEE 1394 controller 15, and the printer engine 16, via the main bus 18.

[0027] In the host computer, the processing to be performed in accordance with the present invention is divided into a print data transmission program and a bus reset interrupt processing program. In the printer, the processing to be performed in accordance with the present invention is divided into a print data reception program and a bus reset interrupt processing program.

[0028] It is assumed that SBP-2 is automatically logged out when a specified apparatus is disconnected from the bus.

[0029] The print data transmission program for the host computer will now be described while referring to FIG. 4.

[0030] First, the program waits for print data to be prepared and for a printing request to be issued by a user (S401).

[0031] When a printing request is issued, an application in the host computer produces additional print data based on the data prepared by the user (S402). To initiate the transmission of data to the printer, a login process for the printer is performed in accordance with the rules established for SBP-2 by the IEEE 1394 controller 5 connected to the IEEE 1394 line (S403). A check is then performed to determine whether the login was successful (S404). If the login was not successful, it is assumed that the operating condition of the printer is abnormal or that the printer is busy, and a user is notified via the user I/F display 6 that the printer can not be used at the present (S405). Thereafter, the print data that were prepared are cleared (S406).

[0032] If the login was successful, however, login identifier “NULL” is transmitted along the IEEE 1394 line, via the IEEE 1394 controller 5, to the printer, in order to notify the printer that a new printing request has been received (S407). Then, the program waits for the reception of a login identifier that is issued by the printer relative to the printing request (S408). Upon receiving the login identifier, its value is stored in a “PRNLOGINID” area in the RAM 2 (S409). Thereafter, the user is requested to enter the time for the session time-out via the user I/F display 6 (S410). The program then waits for the user to employ the input unit 4 to enter the time for the session time-out (S411). When the user enters the time, its value is stored in a “SESSIONTIME” area in the RAM 2 (S412), and the value stored in the “SESSIONTIME” area in the RAM 2 is transmitted via the IEEE 1394 controller 5 and the IEEE 1394 line to the printer (S413). Then the transmission of the print data to the printer is begun via the IEEE controller 5 and the IEEE 1394 line (S414). When the printer data have been transmitted, the data transmission process is terminated (S415), and by logging out the printer, which is performed in accordance with the rules established for SBP-2, the communication process is also terminated (S416). Then, the process at step S401 is performed while the program waits for the next printing request.

[0033] An explanation will now be given, while referring to FIGS. 5A and 5B, for the processing performed by the host computer when the printer is disconnected from the IEEE 1394 line while print data are being transmitted.

[0034] This processing is performed in accordance with a host computer interrupt program that is initiated by an IEEE 1394 bus reset.

[0035] When an interrupt occurs (S500), a check is performed to determine whether the interrupt is the result of an IEEE 1394 bus reset at a lower layer shown in FIG. 8 (a lower layer detects the disconnection of a line, or the connection of a new apparatus to a line, and performs a line disconnection) (S501). If the interrupt is not the result of a bus reset, an interrupt routine that corresponds to the reason for the interrupt is activated and the appropriate processing is performed (S502). The processing is thereafter terminated (S522). If the interrupt is the result of a bus reset, a check is performed to determine whether print data are currently being transmitted to the printer (S503). When print data are not being transmitted, it is assumed that there is no event to be processed, and the interrupt process is terminated (S522).

[0036] When print data are being transmitted, a check is performed to determine, via the IEEE 1394 controller 5 on the IEEE 1394 line, whether a printer in a session is currently connected to the bus (S504). If the printer in the session is connected, it is assumed that the bus reset does not adversely affect the communications performed by the and the interrupt process is terminated (S522). If the pertinent printer is not connected, it is assumed that the printer that is receiving data is not connected to the bus, and a logout process for the internal communication performed by the host computer (an abnormality end process) is performed (S505). The timer for the host computer is started and measures the elapsed time since the printer was disconnected from the bus (S506). The elapsed time is stored in an area “TIME” in the RAM 2. A value in “TIME” is then compared with a value in “SESSIONTIME” (S507).

[0037] When the value in “TIME” is >the value in “SESSIONTIME”, it is assumed that the session time has expired, and print data stored in the host computer are cleared (S519) and all the tasks associated with the transmission of print data are initialized (S520). Then, the user is notified via the user I/F display 6 that printing has been halted (S521). The processing is thereafter terminated (S522).

[0038] When the value in “TIME” is <the value in “SESSIONTIME”, it is assumed that the session time has not yet expired, and a check is performed to determine whether the printer in the session has been reconnected to the bus (S508). If the printer has not yet been re-connected, the process at step S507 is repeated.

[0039] When the printer in use during the session has been re-connected, the login of the printer in the session is again performed in accordance with the rules established for SBP-2 (S509). A check is thereafter performed to determine whether the login has been successful (S510). If the login has not been successful, it is assumed that an abnormality has occurred at the printer, and the user is notified via the user I/F display 6 that the printer can not presently be used (S517). Thereafter, print data stored in the host computer are cleared (S518), and all the tasks associated with the transmission of print data are initialized. If the login has been successful, however, a login ID that is stored as a login identifier in area “PRNLOGINID” is transmitted along the IEEE 1394 line via the IEEE 1394 controller 5 (S511), and reception of permission for continuous reception by the printer is waited for (S512). If permission for continuous reception is not received, the printer is logged out to clear the print data, and all the tasks concerning the transmission of print data are initialized. But when continuous reception is permitted, transmission of print data to the printer is resumed (S513). When the print data have been transmitted, the transmission process is terminated (S514) and the logging out of the printer is performed in accordance with the rules established for SBP-2 for the termination of communication (S515). Then all the tasks associated with the transmission of print data are initialized (S516). The processing is thereafter terminated (S522).

[0040] The processing for receiving print data when the printer is operating normally will now be described while referring to FIG. 6.

[0041] A check is performed to determine whether a login request output along the IEEE 1394 line by the host computer has been received via the IEEE 1394 controller 15 (S601). When a login request has been received, sequentially, checks are performed to determine whether a login identifier has been received (S602), and when one is received, whether the received identifier is a “NULL” (S603). If the login identifier is a “NULL”, it is assumed that the received request is a new printing request, and a new login identifier is issued and is stored in area “LOGINID” in the RAM 12 (S604). Thereafter, the login identifier is transmitted to the host computer (S611) and the reception of a session time from the host computer is waited for (S612). When the session time is received, its value is stored in area “SESSIONTIME” in the RAM 12 (S613). Following this, print data output along the IEEE 1394 line by the host computer are received via the IEEE 1394 controller 15 (S614). After the reception of print data has ended (S615) and a logout notification has been received from the host computer (S616), the communication process is terminated. Printing is then initiated by the printer engine 16 (S610).

[0042] If the received login identifier is not a “NULL”, however, it is assumed that the request is for the continuous transmission of print data that has been halted, and a check is performed to determine whether the print data for the received login identifier are valid (S604). When the print data are not valid, an abnormal end notification is transmitted to the host computer to terminate the communication process (S605), the printer is initialized (S606), and the process at step S601 is repeated.

[0043] When the received print data are valid, permission for continuous reception is transmitted via the IEEE 1394 controller 15 and along the IEEE 1394 line to the host computer (S607), and the reception of print data from the host computer is resumed (S608). When the reception of data has been completed (S609) and a logout notification has been received from the host computer, the communication process is terminated (S616) and printing is initiated by the printer engine 16 (S610). Thereafter, the process at step S601 is repeated.

[0044] An explanation will now be given, while referring to FIG. 7, for the processing performed by the printer when the host computer is disconnected from the IEEE 1394 line during the transmission of print data.

[0045] This processing is performed by a program for processing an interrupt that occurs as the result of an IEEE 1394 bus reset.

[0046] When an interrupt has occurred (S700), a check is performed to determine whether the interrupt is the result of an IEEE 1394 bus reset (S701). If the interrupt is not the result of a bus reset, an interrupt routine that corresponds to the cause of the interrupt is activated, the appropriate processing is performed (S702), and the processing is thereafter terminated (S710). However, if the interrupt was the result of a bus reset, a check is performed to determine, via the IEEE 1394 controller 5 and the IEEE 1394 line, whether the host computer in the session is currently connected to the bus (S703). If the host computer in the session is connected to the bus, it is assumed that the bus reset has not adversely affected communication by the printer and the interrupt process is terminated (S710). If the host computer in the session is not connected, it is assumed that the host computer that was transmitting the data has been disconnected from the bus and a logout process is performed inside the printer (an abnormal end process) (S704). The timer for the printer is activated to measure the time that has elapsed since the host computer was disconnected from the bus, and the elapsed time is stored in area “TIME” in the RAM 12 (S705). Thereafter, the value stored in “TIME” is compared with the value stored in “SESSIONTIME” (S706).

[0047] If the value stored in “TIME”≧the value stored in “SESSIONTIME”, it is assumed that the session time has expired and the print data that are stored in the printer are cleared (S708). Then, all the tasks concerning the transmission of print data are initialized (S709) and the processing is thereafter terminated (S710).

[0048] If the value stored in “TIME”<the value in “SESSIONTIME”, it is assumed that the session time has not yet expired, and a check is performed to determine whether the host computer in the session has been reconnected to the bus (S707). If the host computer has not been re-connected, the process at step S706 is repeated.

[0049] If the host computer in the session has been reconnected, the processing is thereafter terminated (S710).

[0050] An explanation will now be given, while referring to FIG. 8, for the form of the present invention as it compares with an OSI (Open System Interconnection) seven layer model composed in accordance with the international standard.

[0051] The lower layer of the OSI seven layer model includes a physical layer, a data link layer, a network layer and a transport layer; and the upper layer includes a session layer, a presentation layer and an application layer. When the individual layers are compared with the means provided by the present invention, it is apparent that the functions of the upper layer are implemented by the control provided by the programs shown in FIG. 4 and FIGS. 5A and 5B, and that the functions of the lower layer are implemented by the control provided by SBP-2, as determined by IETF and by IEEE 1394.

(Second Embodiment)

[0052] While in the first embodiment the session time is set by a user, the session time can be fixed by a system. Further, in the first embodiment, the session time for the disconnection of the host computer from the bus is equals that for the disconnection of the printer. However, a different session time can be set for each case.

(Third Embodiment)

[0053] In the first embodiment, the IEEE 1394 line is employed by the host computer to transmit data to the printer. However, it can be easily understood that a great economical effect can be obtained when this control method is applied when transmitting a large amount of data along a line for which a transmission fee is charged.

[0054] According to the present invention, if a plurality of image sources and a plurality of printers can be connected to a single, closed communication line like the IEEE 1394, and if an image data source in a connection that is transmitting data is disconnected from the line, the printer can exchange data with another image source along another line so long as a predetermined time has expired.

[0055] Since the upper layer is not immediately disconnected upon the disconnection of the lower layer, even when the disconnection and the re-connection of a line occurs due to a careless mistake or the rearrangement of apparatuses by a user, the continuous transmission of data can be sustained so long as the line connection is re-established within a predetermined time. As a result, as concerns printing, paper, time and ink (toner) are not wasted.

[0056] According to the present invention, even if a line disconnection occurs, data received before then can be effectively employed. 

What is claimed is:
 1. A communication control apparatus comprising: control means for, when a lower layer is disconnected while data is being transmitted to a different apparatus, permitting an upper layer to maintain a session for a predetermined period of time, and for, when a line connection is re-established within said predetermined period of time, permitting said upper layer to establish a connection for the transmission of data.
 2. A communication control apparatus according to claim 1 further comprising: setting means for setting said predetermined time.
 3. A communication control apparatus according to claim 1, wherein said control means includes: time determination means for determining whether a predetermined time has elapsed; re-connection determination means for determining whether a different apparatus in a session has been reconnected to a bus by the time said time determination means determines said predetermined time has elapsed; login determination means for, when said reconnection means determines that said different apparatus has been re-connected, determining whether a login to said different apparatus has been successful; reception determination means for, when said login determination means determines that said login has been successful, determining whether said different apparatus is capable of continuous reception; and means for, when said reception determination means determines that continuous reception has been enabled, transmitting data to said different apparatus.
 4. A communication control apparatus according to claim 1, wherein said control means includes: time determination means for determining whether a predetermined time has elapsed; and clearing means for, when said time determination means determines that said predetermined time has elapsed, clearing data that are being transmitted.
 5. A communication control apparatus according to claim 1, wherein said lower layer is a layer for ensuring the transmission of data, and detects a line disconnection or a line abnormality and performs a line disconnection process.
 6. A communication control apparatus according to claim 1, wherein said lower layer includes a transport layer defined in an OSI layer 7 and below, and said upper layer includes a session layer defined in said OSI layer 7 and above.
 7. A communication control apparatus according to claim 1, wherein SBP-2 is employed as a protocol for said transport layer and below.
 8. A communication control apparatus according to claim 1, wherein IEEE 1394 is employed as a physical layer, which is the lowest layer.
 9. A communication control apparatus according to claim 1, wherein said apparatus is a computer, and the different apparatus being a printer.
 10. A communication control apparatus according to claim 1, wherein disconnection of said lower layer occurs when said different apparatus is physically disconnected from a line, or when a new apparatus is connected to said line.
 11. A communication control method comprising: a control step of, when a lower layer is disconnected while data is being transmitted to another apparatus, permitting an upper layer to maintain a session for a predetermined period of time, and for, when a line connection is re-established within said predetermined period of time, permitting said upper layer to establish a connection for the transmission of data.
 12. A communication control method according to claim 11, further comprising: a setting step of setting said predetermined time.
 13. A communication control method according to claim 11, wherein said control step includes: a time determination step of determining whether a predetermined time has elapsed; a re-connection determination step of determining whether a different apparatus in a session. has been reconnected to a bus by the time it is determined at said time determination step that said predetermined time has elapsed; a login determination step of, when it is determined at said re-connection step that said different apparatus has been re-connected, determining whether a login to said different apparatus has been successful; a reception determination step of, when it is determined at said login determination'step that said login has been successful, determining whether said different apparatus is capable of continuous reception; and a step of, when it is determined at said reception determination step that continuous reception has been enabled, transmitting data to said different apparatus.
 14. A communication control method according to claim 11, wherein said control step includes: a time determination step of determining whether a predetermined time has elapsed; and a clearing step of, when it is determined at said time determination step that said predetermined time has elapsed, clearing data that are being transmitted.
 15. A communication control method according to claim 11, wherein said lower layer is a layer for ensuring the transmission of data, and detects a line disconnection or a line abnormality and performs a line disconnection process.
 16. A communication control method according to claim 11, wherein said lower layer includes a transport layer defined in an OSI layer 7 and below, and said upper layer includes a session layer defined in said OSI layer 7 and above.
 17. A communication control method according to claim 11, wherein SBP-2 is employed as a protocol for said transport layer and below.
 18. A communication control method according to claim 11, wherein IEEE 1394 is employed as a physical layer, which is the lowest layer.
 19. A communication control method according to claim 11, wherein said method is executed by a computer, and the different apparatus is a printer.
 20. A communication control method according to claim 11, wherein disconnection of said lower layer occurs when said different apparatus is physically disconnected from a line, or when a new apparatus is connected to said line.
 21. A machine-readable storage medium which stores a communication control program, said communication control program comprising: a control step of, when a lower layer is disconnected while data is being transmitted to another apparatus, permitting an upper layer to maintain a session for a predetermined period of time, and for, when a line connection is re-established within said predetermined period of time, permitting said upper layer to establish a connection for the transmission of data.
 22. A storage medium according to claim 21, wherein said communication control program further comprises: a setting step of setting said predetermined time.
 23. A storage medium according to claim 21, wherein said control step includes: a time determination step of determining whether a predetermined time has elapsed; a re-connection determination step of determining whether a different apparatus in a session has been reconnected to a bus by the time it is determined at said time determination step that said predetermined time has elapsed; a login determination step of, when it is determined at said re-connection step that said different apparatus has been re-connected, determining whether a login to said different apparatus has been successful; a reception determination step of, when it is determined at said login determination step that said login has been successful, determining whether said different apparatus is capable of continuous reception; and a step of, when it is determined at said reception determination step that continuous reception has been enabled, transmitting data to said different apparatus.
 24. A storage medium according to claim 21, wherein said control step includes: a time determination step of determining whether a predetermined time has elapsed; and a clearing step of, when it is determined at said time determination step that said predetermined time has elapsed, clearing data that are being transmitted.
 25. A storage medium according to claim 21, wherein said lower layer is a layer for ensuring the transmission of data, and detects a line disconnection or a line abnormality and performs a line disconnection process.
 26. A storage medium according to claim 21, wherein said lower layer includes a transport layer defined in an OSI layer 7 and below, and said upper layer includes a session layer defined in said OSI layer 7 and above.
 27. A storage medium according to claim 21, wherein SBP-2 is employed as a protocol for said transport layer and below.
 28. A storage medium according to claim 21, wherein IEEE 1394 is employed as a physical layer, which is the lowest layer.
 29. A storage medium according to claim 21, wherein said medium is used by a computer, and the different apparatus is a printer.
 30. A storage medium according to claim 21, wherein disconnection of said lower layer occurs when said different apparatus is physically disconnected from a line, or when a new apparatus is connected to said line. 